﻿<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>充值页面</title>
	<div th:include="Common/common :: head"></div>
<link rel="stylesheet" type="text/css" th:href="@{/assets/css/amazeui.min.css}" />
<link rel="stylesheet" type="text/css"  th:href="@{/assets/css/main.css}" />

</head>
<body>
<div id="main-wrapper">
	<div th:include="Common/common :: header"></div>
	<div class="container">
<div class="pay">
	<!--主内容开始编辑-->
	<div class="tr_recharge">
		<div class="tr_rechtext">
			<p class="te_retit"><img th:src="@{/assets/images/coin.png}" alt="" />充值中心</p>
			<p>1.劲松币是劲松为招兵买马推出的虚拟货币，你可以使用劲松币购买站内的游戏。</p>
			<p>2.招兵币与人民币换算为1：1，即1元=1劲松币，你可以选择支付宝进行充值，劲松币每次10个起充。</p>
		</div>
		<form th:action="@{/pay/confirm}" class="am-form" id="doc-vld-msg" method="get">
			<div class="tr_rechbox">
				<div class="tr_rechhead">
					<img th:src="@{/assets/images/game/wjs.jpg}" width="30" height="30" class="rounded-circle"/>
					<p>充值帐号：
						<a th:text="${session.user.nickname}">王凯</a>
					</p>
					<div class="tr_rechheadcion">
						<img th:src="@{/assets/images/coin.png}" alt="" />
						<span>当前余额：<span th:text="${session.user.account}+'劲松币'">1000劲松币</span></span>
					</div>
				</div>

				<div class="tr_rechli am-form-group">
					<ul class="ui-choose am-form-group" id="uc_01">
						<li>
							<label class="am-radio-inline">
									<input type="radio"  value="100" name="money"  required data-validation-message="请选择一项充值额度"> 100￥
								</label>
						</li>
						<li>
							<label class="am-radio-inline">
									<input type="radio" value="200" name="money" data-validation-message="请选择一项充值额度"> 200￥
								</label>
						</li>

						<li>
							<label class="am-radio-inline">
									<input type="radio" name="money" value="500" data-validation-message="请选择一项充值额度"> 500￥
								</label>
						</li>
						<li>
							<label class="am-radio-inline">
									<input type="radio" name="money1" value="" id="wjs" data-validation-message="请选择一项充值额度"> 其他金额
								</label>
						</li>
					</ul>
				</div>
				<div class="tr_rechoth am-form-group">
					<span>其他金额：</span>
					<input type="number" min="10" max="10000"  class="othbox"  data-validation-message="充值金额范围：10-10000元" />
				</div>
				<div class="tr_rechcho am-form-group">
					<span>充值方式：</span>
					<label></label>
					<label class="am-radio" style="margin-right:30px;">
							<img th:src="@{/assets/images/zfbpay.png}">
						</label>
				</div>
				<div class="tr_rechnum">
					<span>应付金额：</span>
					<p class="rechnum">0.00元</p>
				</div>
			</div>
			<div class="tr_paybox">
				<input type="submit" value="确认支付" class="tr_pay am-btn" />
				<span>温馨提示：劲松币只限于在商城中购买游戏，遇到问题请拨打联系电话18672208284。</span>
			</div>
		</form>
	</div>
</div>
	</div>
	<div th:include="Common/common :: laster"></div>
</div>

<script type="text/javascript" th:src="@{/assets/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/assets/js/amazeui.min.js}"></script>
<script type="text/javascript" th:src="@{/assets/js/ui-choose.js}"></script>
<script type="text/javascript">
	// 将所有.ui-choose实例化
	$('.ui-choose').ui_choose();
	// uc_01 ul 单选
	var uc_01 = $('#uc_01').data('ui-choose'); // 取回已实例化的对象
	uc_01.click = function(index, item) {
		console.log('click', index, item.text())
	}
	uc_01.change = function(index, item) {
		console.log('change', index, item.text())
	}
	$(function() {
		$('#uc_01 li:eq(3)').click(function() {
			$('.tr_rechoth').show();
			$('.tr_rechoth').find("input").attr('required', 'true')
			$('.rechnum').text('100.00元');
		})
		$('#uc_01 li:eq(0)').click(function() {
			$('.tr_rechoth').hide();
			$('.rechnum').text('100.00元');
			$('.othbox').val('');
		})
		$('#uc_01 li:eq(1)').click(function() {
			$('.tr_rechoth').hide();
			$('.rechnum').text('200.00元');
			$('.othbox').val('');
		})
		$('#uc_01 li:eq(2)').click(function() {
			$('.tr_rechoth').hide();
			$('.rechnum').text('500.00元');
			$('.othbox').val('');
		})
		$(document).ready(function() {
			$('.othbox').on('input propertychange', function() {
				var num = $(this).val();
				$("#wjs").attr("value",num);
				$('.rechnum').html(num + ".00元");
			});
		});
	})

	$(function() {
		$('#doc-vld-msg').validator({
			onValid: function(validity) {
				$(validity.field).closest('.am-form-group').find('.am-alert').hide();
			},
			onInValid: function(validity) {
				var $field = $(validity.field);
				var $group = $field.closest('.am-form-group');
				var $alert = $group.find('.am-alert');
				// 使用自定义的提示信息 或 插件内置的提示信息
				var msg = $field.data('validationMessage') || this.getValidationMessage(validity);

				if(!$alert.length) {
					$alert = $('<div class="am-alert am-alert-danger"></div>').hide().
					appendTo($group);
				}
				$alert.html(msg).show();
			}
		});
	});
</script>
<div style="text-align:center;">
</div>
</body>
</html>